﻿using UnityEngine;
using System.Collections.Generic;

public class ObjectPool : MonoBehaviour
{
    public static ObjectPool Instance;

    void Awake()
    {
        Instance = this;
    }

    public GameObject[] Prefabs;
    private Dictionary<string, List<GameObject>> _objectPool;
    private Dictionary<string, GameObject> _prefabsPool;

    void Start()
    {
        Init();
    }

    void Init()
    {
        _objectPool = new Dictionary<string, List<GameObject>>();
        _prefabsPool = new Dictionary<string, GameObject>();
        int tempPrefabLength = Prefabs.Length;
        for (int i = 0; i < tempPrefabLength; i++)
        {
            _prefabsPool.Add(Prefabs[i].name, Prefabs[i]);
        }
    }

}
